package my.common.util.file;

import java.net.HttpURLConnection;
import java.net.URL;

public class FileUtils {
	public static boolean checkReomoteFileExits(String fileURL) {
		try {
			URL url = new URL(fileURL);
			HttpURLConnection urlcon2 = (HttpURLConnection) url.openConnection();
			String message = urlcon2.getHeaderField(0);
			System.out.println(message);
			if (message.indexOf("200") > 0) {

				return true;
			} else {
				return false;
			}
		} catch (Exception e) {
			e.printStackTrace();
			return false;
		}

	}
	
	public static void main(String[] args) {
	String url=	"http://localhost:2020/files/vertx-demo1-1.0-SNAPSHOT4.jar::DemoRestVerticle";
	int index=url.indexOf("::");
	String jarUrl=url.substring(0, index);
	System.out.println(jarUrl);
	}

}
